package demo5;

import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-08-16
 * Time: 8:44
 */
public class TestDemo {

    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        System.out.println(stack);
        Stack<Integer> stack1 = new Stack<>();
        while(!stack.isEmpty()){
            stack1.push(stack.pop());
        }
        System.out.println(stack1);
    }

}
